home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Games / flying-6.11 / goal.C < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-30  |  682 b   |  44 lines

  1. #ifndef _global_h
  2. #    include "global.h"
  3. #endif
  4.  
  5. #ifndef _goal_h
  6. #    include "goal.h"
  7. #endif
  8. #ifndef _ball_h
  9. #    include "ball.h"
  10. #endif
  11. #ifndef _game_h
  12. #    include "game.h"
  13. #endif
  14.  
  15.  
  16.  
  17. Goal::Goal(const Vec2 &v1, const Vec2 &v2 )
  18. : Wall(v1,v2) {
  19.     type   = GoalObj;
  20.     dyn_id = -2;        // Kennzeichnung der Goals fuer PreCalc des Pointers
  21. }
  22.  
  23.  
  24. Goal::~Goal()    {}
  25.  
  26.  
  27. void Goal::Info() {
  28.     printf( "%02d: Goal:       %08lx: (%4.1f,%4.1f) - (%4.1f,%4.1f)\n",
  29.                 Object::id, (unsigned long)this,
  30.                 (double)p1.X(), (double)p1.Y(),
  31.                 (double)p2.X(), (double)p2.Y() );
  32. }
  33.  
  34.  
  35. void Goal::CollideWithBall( Ball *b ) {
  36.     if (b->type==BallObj) {
  37.         g->TakeOffBoard(b);
  38.     }
  39.     else {
  40.         Wall::CollideWithBall(b);
  41.     }
  42. }
  43.  
  44.